<?php

// Laad Muffin !!
require 'Muffin.class.php';
define( 'SMARTY_DIR', 'libs/' );
$m = Muffin::init(false);

?>

<script type="text/javascript" src="../templates/js/tinymce/tiny_mce.js"></script>
<script type="text/javascript" src="../templates/js/muffin.fn.js"></script>

<?php

// Als er gepost is dan...
if( isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'addnews' )
{
	// Als het toevoegen gelukt is, shadowbox sluiten en de pagina herladen
	if( $m->setNews($_POST) )
		echo '<script type="text/javascript">closeAndReload();</script>';
}

?>

<form method="post" action="?mode=addnews">
	
	<label for="newstitle" style="font-family:verdana;">Titel:</label>
	<input type="text" name="newstitle" id="newstitle" size="64" maxlength="64" />
	
	<br /><br />
	
	<textarea id="newsbody" name="newsbody" rows="15" cols="80" style="width: 600px; height: 340px;"></textarea>

	<br />
	<div style="text-align: right;">
		<input type="submit" name="save" value="Save" />
		<input type="button" value="Cancel" onclick="closeShadowBox();" />
	</div>
</form>

<script type="text/javascript">
	tinyMCE.init( {
		mode : "textareas",
		theme : "advanced",
		theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
		theme_advanced_buttons2 : "",
		theme_advanced_buttons3 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
	} );	
</script>